BigDFT.Interop.RDKitInterop module

This module contains some wrappers for using OpenBabel to perform various operations with RDKit.

https://www.rdkit.org/docs/api-docs.html

convert_system_to_rdkit(sys)[source]

Convert a BigDFT system to rdkit molecule.

Parameters:

sys (BigDFT.Systems.System) – the system to convert.

Returns:

an rdkit type molecule.

Return type:

(rdkit.Chem.rdchem.Mol)

compute_rdkit_matching(sys, rdsys, check_matching=True)[source]

Similar to the cannonical compute matching of the system class, this creates a lookup table mapping each atom in a system class to the index of the atom in a rdkit system.

Parameters:
  • sys (BigDFT.Systems.System) – the bigdft system.

  • bsys (rdkit.Chem.rdchem.Mol) – the rdkit version of the system.

  • check_matching (bool) – if set to True, this will raise an error if we can’t match all of the atoms in the system.

Returns:

a mapping from a system to indices in the atom list. If

an atom is not in the list, an index value of -1 is assigned.

Return type:

(dict)

rdkit_visualize(sys, colordict=None, format='SVG')[source]

Visualize a molecule and its fragments using RDKit.

Parameters:
  • sys (BigDFT.Systems.System) – the system to visualize.

  • colordict (dict) – a dictionary mapping fragments to colors.

  • format (str) – either SVG or Cairo.

Returns:

the image to display. If it’s SVG use SVG(result), Cairo Image(result).

Return type:

(str)